package com.daoeping.data;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Usr_education entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "usr_education", catalog = "daoeping")
public class Usr_education implements java.io.Serializable {

	// Fields

	private Integer id;
	private Usr_user usr_user;
	private Bsc_education bsc_education;
	private Bsc_school bsc_school;
	private Bsc_major bsc_major;
	private Date startDate;
	private Date endDate;
	private String description;

	// Constructors

	/** default constructor */
	public Usr_education() {
	}

	/** minimal constructor */
	public Usr_education(Usr_user usr_user, Bsc_education bsc_education,
			Bsc_school bsc_school, Bsc_major bsc_major) {
		this.usr_user = usr_user;
		this.bsc_education = bsc_education;
		this.bsc_school = bsc_school;
		this.bsc_major = bsc_major;
	}

	/** full constructor */
	public Usr_education(Usr_user usr_user, Bsc_education bsc_education,
			Bsc_school bsc_school, Bsc_major bsc_major, Date startDate,
			Date endDate, String description) {
		this.usr_user = usr_user;
		this.bsc_education = bsc_education;
		this.bsc_school = bsc_school;
		this.bsc_major = bsc_major;
		this.startDate = startDate;
		this.endDate = endDate;
		this.description = description;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id", nullable = false)
	public Usr_user getUsr_user() {
		return this.usr_user;
	}

	public void setUsr_user(Usr_user usr_user) {
		this.usr_user = usr_user;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "education_id", nullable = false)
	public Bsc_education getBsc_education() {
		return this.bsc_education;
	}

	public void setBsc_education(Bsc_education bsc_education) {
		this.bsc_education = bsc_education;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "school_id", nullable = false)
	public Bsc_school getBsc_school() {
		return this.bsc_school;
	}

	public void setBsc_school(Bsc_school bsc_school) {
		this.bsc_school = bsc_school;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "major_id", nullable = false)
	public Bsc_major getBsc_major() {
		return this.bsc_major;
	}

	public void setBsc_major(Bsc_major bsc_major) {
		this.bsc_major = bsc_major;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "start_date", length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "end_date", length = 10)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(name = "description", length = 200)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

}